#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
using namespace std;
#include<stdio.h>
int Get(int year, int month)
{
	int data[13] = { -1,31,28,31,30,31,30,31,31,30,31,30,31 };
	if (month == 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))
	{
		return 29;
	}
	return data[month];
}

int main()
{
	int a, b, c;
	int sum = 0;
	cin >> a >> b >> c;
	//a = 2012, b = 12, c = 31;
	if (Get(a, b) < c)
	{
		exit(1);
	}
	if (a >= 1900 && a <= 2200 && b <= 12 && b > 0)
	{

		for (int i = 1; i < b; i++)
		{
		
			sum += Get(a, i);
		}
	}
	else
	{
		exit(1);
	}
	cout << sum + c;
	
	
}

#include <iostream>
using namespace std;
int day[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
int leap(int year)
{
	if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
	{
		return 1;
	}
	return 0;
}

int main()
{
	int a, b, c;
	int x, y, z;
	scanf("%4d%2d%2d", &a, &b, &c);
	scanf("%4d%2d%2d", &x, &y, &z);

	int sum1 = 0;
	int sum2 = 0;
	for (int i = 0; i < a; i++)
	{
		if (leap(i))
		{
			sum1 += 366;
		}
		else 
		{
				sum1 += 365;
		}
	}
	if (leap(a))
		day[2] = 29;
	else
		day[2] = 28;
	for (int mm = 1; mm < b; mm++)
	{
		sum1 += day[mm];
	}
	sum1 += c;

	for (int yy = 0; yy < x; yy++)
	{
		if (leap(yy))
			sum2 += 366;
		else
			sum2 += 365;
	}
	if (leap(x))
		day[2] = 29;
	else
		day[2] = 28;
	for (int mm = 1; mm < y; mm++)
	{
		sum2 += day[mm];
	}
	sum2 += z;
	cout << abs(sum1 - sum2) + 1 << endl;

	return 0;
}
